Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content Profile - > Width field although required can be saved without initialization #4371

Conversation

dzonidoo
Copy link
Collaborator

@dzonidoo dzonidoo commented Nov 9, 2023

SDESK-7099

@dzonidoo dzonidoo requested a review from petrjasek November 9, 2023 17:41
@@ -100,7 +100,7 @@ export function getSelectSingleValue(
<label className="sd-line-input__label">{this.props.formField.label}</label>
<select
disabled={this.props.disabled || this.state.items == null || this.state.items.length < 1}
value={this.props.value || ''}
value={this.props.value || this.state.items[0].id}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like a good solution to me. If the problem is that an empty value is being saved, we can solve it by either adding validation or not allowing empty value. If we're going with an approach of not allowing empty values, we'd need to add a prop to this component and in that case don't render the <option> tag with empty string a a value. The display of value shouldn't be messed with. The value should be displayed as it is.

@tomaskikutis
Copy link
Member

will solve on the back-end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants